//
//  CGQyunweiTableViewCell.swift
//  SheYangBigData
//
//  Created by 叁拾叁 on 2021/4/20.
//  Copyright © 2021 叁拾叁. All rights reserved.
//

import UIKit

class CGQyunweiTableViewCell: SYBaseCell {

    var bgView: UIView = {
        let v = UIView()
        v.backgroundColor = .white
        v.layer.masksToBounds = true
        v.layer.cornerRadius = 5
        return v
    }()
    let title: UILabel = {
        let v = UILabel()
        v.text = "项目名称"
        v.font = 15.autoFontSize()
        v.font = UIFont(name: "PingFang-SC-Bold-Bold", size: 17.autoWidth())
        v.textColor = UIColor(hex: 0x333333)
        return v
    }()
    var lv: UIView = {
        let v = UIView()
        v.backgroundColor = UIColor(hex: 0xF0F0F0)
        return v
    }()
 
    let riqi: CGQduankouView = {
        let v = CGQduankouView()
        v.title.text = "操作时间："
        v.num.text = "设备编号："
        return v
    }()
    let beizhu: UILabel = {
        let v = UILabel()
        v.text = "备注："
        v.font = 14.autoFontSize()
        v.textColor = UIColor(hex: 0x333333)
        v.textAlignment = .right
        return v
    }()
    
    let beizhuDetail: UILabel = {
        let v = UILabel()
        v.text = ""
        v.font = 14.autoFontSize()
        v.textColor = UIColor(hex: 0x666666)
        v.numberOfLines = 0

        return v
    }()

    
    
    public func configureView(model: NSYuweiRecordsModel) {
        title.text = model.businessName
        riqi.num.text = model.createDate
        beizhuDetail.text = model.remarks ?? "暂无内容"

        
    }
    override func initViews() {
        self.backgroundColor = UIColor(hex: 0xF7F7F7)
        contentView.addSubview(bgView)
        contentView.addSubview(title)
        contentView.addSubview(lv)
        contentView.addSubview(riqi)
        contentView.addSubview(beizhu)
        contentView.addSubview(beizhuDetail)

        
        
        bgView.snp.makeConstraints { (make) in
            make.top.equalToSuperview().offset(autoWidth(10))
            make.left.equalToSuperview().offset(autoWidth(10))
            make.right.equalToSuperview().offset(autoWidth(-10.0))
            make.bottom.equalToSuperview()
            
        }
        
        title.snp.makeConstraints { (make) in
            make.top.equalToSuperview().offset(autoWidth(10))
            make.left.equalToSuperview().offset(autoWidth(23))
            make.right.equalToSuperview().offset(autoWidth(-20))
            make.height.equalTo(50.autoWidth())
            
        }
        
        lv.snp.makeConstraints { (make) in
            make.top.equalTo(title.snp.bottom).offset(0)
            make.left.equalToSuperview().offset(autoWidth(23))
            make.right.equalToSuperview().offset(autoWidth(-20))
            make.height.equalTo(0.5)
            
        }
   
        riqi.snp.makeConstraints { (make) in
            make.top.equalTo(lv.snp.bottom).offset(autoWidth(18))
            make.left.equalToSuperview().offset(autoWidth(23))
            make.right.equalToSuperview().offset(autoWidth(-20))
            
        }
        
        beizhu.snp.makeConstraints { (make) in
            make.top.equalTo(riqi.snp.bottom).offset(autoWidth(26))
            make.left.equalToSuperview().offset(autoWidth(33))
            make.width.equalTo(70.autoWidth())
            make.height.equalTo(13.autoWidth())

        }
        
        beizhuDetail.snp.makeConstraints { (make) in
            make.top.equalTo(beizhu.snp.top)
            make.left.equalTo(beizhu.snp.right).offset(16.autoWidth())
            make.right.equalToSuperview().offset(autoWidth(-20))
            make.bottom.equalToSuperview().offset(autoWidth(-10))
        }
        
        
    }
    
}
